package com.group1.bookmanagement.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.group1.bookmanagement.domain.Label;
import com.group1.bookmanagement.service.LabelService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@Controller("labelAction")
@Scope("prototype")
public class LabelAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	@Resource(name = "labelService")
	private LabelService labelService;
	
	public String listLabel() {
		ActionContext context = ActionContext.getContext();
		List<Label> list = labelService.listLabel();
		context.put("list", list);
		
		return SUCCESS;
	}

}
